<div class="collection">
    <div class="nav">
        <a href="#personal/collection">
            <div class="nav-li">收藏店铺</div>
        </a>
        <div class="nav-li focus">收藏商品</div>
    </div>

    <hr />

    <div class="collection-box">
    {{#each $Cache.user.collect_detail}}
        <collectiongoods href="{{url}}" src="{{preview_img_url}}?imageView/1/w/200/h/200" goodsname="{{goods_name}}" price="{{price}}"></collectiongoods>
    {{/each}}
    </div>
</div>
<xmp type="tag" name="collectiongoods">
    <div class="goodsitem">
       <!--  <div class="btnbox">
            <button event-click="{{'$Top.$Event.user.collect_goods_add_to_cart'}}" class="icon-cart" title="添加到购物车"></button>
            <button event-click="{{'$Top.$Event.remove_goods_from_collect'}}" class="icon-remove2" title="移除"></button>
        </div> -->
        <div class="imgbox">
            <a href="${href}">
                <img class="goodsimg" src="${src}" />
            </a>
        </div>
        <div class="infobox">
            <div class="item"><a target="_blank" href="${href}" class="goodsname">${goodsname}</a></div>
            <div class="item">￥${price}</div>
            <div class="item">
                <button event-click="{{'$Top.$Event.user.collect_goods_add_to_cart'}}">添加到购物车</button>
            <button event-click="{{'$Top.$Event.remove_goods_from_collect'}}">移除</button>
            </div>
        </div>
    </div>
    <script type="text/vm">
    function(vm) {
        var box = vm.queryElement({
            className: "imgbox"
        })[0];
        require(['jQuery'], function() {
            $(box).css('height', $(box).width()*0.7);
        })
    }
    </script>
</xmp>
